package exttable.testfiller.formcomponents;

import javax.swing.*;
import java.sql.ResultSet;
import java.util.Vector;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: Apr 7, 2010
 * Time: 10:10:53 PM
 * To change this template use File | Settings | File Templates.
 */
public enum EInputComponents {
    J_LABEL {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentJLB(rs, oldData, obj);
        }

    },
    INPUT_TEXT {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentTF(rs, oldData, obj);
        }
    },
    INPUT_TEXT_JTF {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentJTF(rs, oldData, obj);
        }
    },
    INPUT_NUMBER {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentFN(rs, oldData, obj);
        }
    },
    INPUT_DOUBLE {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentFDN(rs, oldData, obj);
        }
    },
    EMAIL {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentEMAIL(rs, oldData, obj);
        }
    },

    SELECT_ONE_MENU {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentCB(rs, oldData, obj);
        }
    },
    SELECT_ONE_MENU_QUESTIONNAIRE{
       @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentCBForQuestionnaire(rs, oldData, obj);
        }
    },

    RADIO_BUTTON {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentRB(rs, oldData, obj);
        }
    },

    TEXT_AREA {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentTA(rs, oldData, obj);
        }
    },


    DATE {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentDT(rs, oldData, obj);
        }
    },

    FILE {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentFileChooser(rs, oldData, obj);
        }
    },

    SKIP_ELEMENT {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return null;
        }
    },
    CODE_SELECT_ONE_MENU {
        @Override
        public JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception {
            return InputJComponents.getComponentCBCode(rs, oldData, obj);
        }

    };

    public abstract JComponent getComponent(ResultSet rs, Vector<Vector<Object>> oldData, Object obj) throws Exception;
}
